package rand;


import java.util.Arrays;
import java.text.NumberFormat;
import java.text.DecimalFormat;

/*
MAIN PARTS OF PROGRAM:
================================
1.  RNG.JAVA  ~ A Pseuedo Random Number Generator Class 
This class generates a set of N random numbers using George Marsaglia's Multiply With Carry Algorithm.
These results are then standardized between 0 and 1
Finally a test class runKolmogorov runs a non parametric hypothesis test to test that the process is random
================================
2.  DISTRIBUTIONS.JAVA
This class provides distribution fitting of the random variable sets that are generated in this class,
for example to fit Gaussian or other distributions
================================
*/

public class Main {

	public static void main(String[] args) {

		//How many random records to generator:
		int N = 5000;
				
		double[] Uniform = new double[N];
		double[] Normal = new double[N];
		double[] Gamma = new double[N];
		
		RNG r1 = new RNG(N);
		
		for (int j = 0; j < N; ++j) {
			Uniform[j] = r1.getUniform();
			Normal[j] = r1.getNormal(5, 2.3);
			Gamma[j] = r1.getGamma(3,4);
				
		}

		//dal.saveDoubleArray("c:\\uniform.txt", Uniform);
		//dal.saveDoubleArray("c:\\Normal.txt", Normal);
		//dal.saveDoubleArray("c:\\Gamma.txt", Gamma);
	  	  	
		//Test for randomness:
		r1.runKolmogorov(Uniform);
		RNG.chisqrNormalityTest(Normal);
		
		
		 

		
	}


}
